<template>
	<view class="u-p-t-10">
		<u-empty v-if="!list.length" text="无数据" mode="page"></u-empty>
		<u-cell-group>
			<view v-for="(item, index) in list" :key="index">
				<u-cell-item :title="item.label" :label="item.value" :arrow="false">
					<u-tag :text="item.sort" />
				</u-cell-item>
				<u-line></u-line>
			</view>
		</u-cell-group>
		<template v-if="visible">
			<uni-fab :pattern="pattern" horizontal="right" vertical="bottom" :popMenu="false" @fabClick="add"></uni-fab>
		</template>
	</view>
</template>

<script>
import fab from '@/components/uni-fab/uni-fab.vue';
export default {
	components: {
		fab
	},
	data() {
		return {
			// 按钮显示
			visible: true,
			// 加号样式
			pattern: {
				buttonColor: '#409EFF'
			},
			model: {},
			list: [],
			type: []
		};
	},
	onShow() {
		this.request({
			url: 'BaseLabel/pages',
			data: {
				limit: 0
			},
			success: res => {
				this.list = res.data;
			}
		});
	},
	onLoad() {
	},
	methods: {
		add() {
			uni.navigateTo({
				url: 'add'
			});
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: #ededed;
}
.user-box {
	background-color: #fff;
}
</style>
